import request from '@/utils/request'

// 查询雪场列表
export function listInfo(query) {
    return request({
        url: '/system/snowField/list',
        method: 'get',
        params: query
    })
}

// 新增雪场信息
export function addInfo(data) {
    return request({
        url: '/system/snowField',
        method: 'post',
        data: data
    })
}

// 修改雪场信息
export function updateInfo(id, data) {
    return request({
        url: `/system/snowField/${id}`,
        method: 'put',
        data: data
    })
}

// 获取雪场信息详细信息
export function getInfo(id) {
    return request({
        url: '/system/snowField/' + id,
        method: 'get'
    })
}

// 删除雪场信息
export function delInfo(id) {
    return request({
        url: '/system/snowField/' + id,
        method: 'delete'
    })
}


// 获取所有套餐列表
export function listMeal() {
    return request({
        url: '/system/meal/all',
        method: 'get',
    })
}

// 关联雪场和用户
export function relatedPerson(userId, data) {
    return request({
        url: `/system/snowField/rel/relatedPerson/` + userId,
        method: 'post',
        data: data
    })
}

// 获取用户绑定的雪场id
export function getSnowField(userId) {
    return request({
        url: '/system/snowField/user/getSnowField/' + userId,
        method: 'get',
    })
}
